package ygw.study.designPatterns.builder;

/**
 * <p>
 * 步骤 7
 * BuiderPatternDemo 使用 MealBuilder 来演示建造者模式（Builder Pattern）。
 * </p>
 * <p>
 * Copyright:2021.All rights reserved.
 * </p>
 * <p>
 * Company:Zsoft
 * </p>
 * <p>
 * CreateDate:2021-10-20 09:49
 * </p>
 *
 * @author YuGongWen
 * @history Mender:YuGongWen；Date:2021-10-20 09:49；
 */
public class BuilderPatternTest {

    public static void main(String[] args) {
        MealBuilder mealBuilder = new MealBuilder();

        Meal vegMeal = mealBuilder.prepareVegMeal();
        System.out.println("Veg Meal");
        vegMeal.showItems();
        System.out.println("Total Cost: " + vegMeal.getCost());

        Meal nonVegMeal = mealBuilder.prepareNonVegMeal();
        System.out.println("\n\nNon-Veg Meal");
        nonVegMeal.showItems();
        System.out.println("Total Cost: " + nonVegMeal.getCost());
    }
}